<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>系统主界面</title>
<%
	if(session.getAttribute("currentAdmin")==null){
		response.sendRedirect("login.jsp");
		return;
	}
%>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.3.3/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/jquery-easyui-1.3.3/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.3.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript">
	$(function(){
		$("#tree").tree({
			lines:true,
			animate:true,
			url:'auth/createtree.action?parentid=0',
			onLoadSuccess:function(){
				$("#tree").tree('expandAll');
			},
			//文档加载完成后,为每个权限节点添加点击事件，增加tab
			onClick:function(node){
				if(node.attributes.authPath){
					openTab(node);
				}
			}
		});
		//
		function openTab(node){
			if($("#tabs").tabs("exists",node.text)){
				$("#tabs").tabs("select",node.text);
			}else{
				var content="<iframe frameborder=0 scrolling='auto' style='width:100%;height:100%' src=views/"+node.attributes.authPath+"></iframe>"
				$("#tabs").tabs("add",{
					title:node.text,
					iconCls:node.iconCls,
					closable:true,
					content:content
				});
			}
		}
	});
	
	//文档加载完成后加载上面代码
</script>
</head>
<body class="easyui-layout">
<div region="north" style="height: 150px; background-image: url('${pageContext.request.contextPath}/img/hdhead.png');">
	<div style="padding: 0px;margin: 0px;background-color: #B1CEE6;">
		<table>
			<tr>
				<td valign="bottom"><font size="3px;">欢迎：${currentAdmin.name }【${currentrole.rolename }】</font>
			</tr>
		</table>
	</div>
</div>
<div region="center">
	<div class="easyui-tabs" fit="true" border="false" id="tabs">
		<div title="首页" data-options="iconCls:'icon-home'">
			<div align="center" > <img alt="" src="${pageContext.request.contextPath}/img/main.jpg"> </div>
		</div>
	</div>
</div>
<div region="west" style="width: 185px;padding: 5px;" title="导航菜单" split="true">
	<div class="easyui-accordion" data-options="fit:true,border:false">
		<div title="人力资源管理板块"  data-options="iconCls:'icon-student'" style="padding:10px">
			<ul id="tree" class="easyui-tree"></ul>
		</div>
		<div title="其他板块管理"  data-options="iconCls:'icon-roleManage'" style="padding:10px">
		</div>
		<div title="系统设置管理"  data-options="iconCls:'icon-item'" style="padding:10px">
			<a href=""  class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-modifyPassword'" style="width: 150px;">修改密码</a>
			<a href="" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-exit'" style="width: 150px;">注销登录</a>
		</div>
	</div>
</div>
<div region="south" style="height:28px;" align="center">
	<a href="http://www.gdou.edu.cn/" target="_blank" style="text-decoration: none;"><font size="3px;">详情请关注海大官网！</font></a>
</div>

</body>
</html>